package com.lsk.finance;

import com.jfinal.core.Controller;
import com.lsk.util.DateUtil;

import java.util.List;
import java.util.Map;

/**
 * 财务统计模块
 */
public class FinanceController extends Controller {
    FinanceService financeService=new FinanceService();
    /**
     * 财务统计
     */
    public void financeStatistics(){
        String startDate=getPara("startDate");
        startDate=startDate==""||startDate==null? DateUtil.getDay():startDate;
        String endDate=getPara("endDate");
        endDate=endDate==""||endDate==null? DateUtil.getDay():endDate;
        String activityId=getPara("activityId");
        Map resultMap=financeService.financeStatisticsService(startDate,endDate,activityId);
        List list=financeService.getAllActivity();
        setAttr("activityList",list);
        setAttr("startDate",startDate);
        setAttr("endDate",endDate);
        setAttr("activityId",activityId);
        setAttr("resultMap",resultMap);
        renderJsp("financeStatistics.jsp");
    }
}
